package com.usian.wemedia.controller;


import com.usian.apis.wemedia.LoginControllerApi;
import com.usian.model.common.dtos.ResponseResult;
import com.usian.model.media.dtos.WmUserDto;
import com.usian.utils.threadlocal.AdminThreadLocalUtils;
import com.usian.wemedia.service.WmUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/login")
public class LoginController implements LoginControllerApi {

    @Autowired
    private WmUserService wmUserService;

    @PostMapping("/in")
    @Override
    public ResponseResult login(@RequestBody WmUserDto dto) {
        return wmUserService.login(dto);
    }

    @GetMapping("/dodo")
    public String dodo(){
        Integer user = AdminThreadLocalUtils.getUser();
        System.out.println(user);
        return "dodo";
    }
}
